package com.job.ZhangMeng.Homework0707.kszy;

public class Teacher {
    public static int num=100;
    public String name;

    //局部代码块{},在方法内使用

    //构造代码块
    {
        this.name="老王";
        System.out.println("----构造代码块执行了----");
    }

    //静态代码块
    static{
        System.out.println("静态代码块执行了!!!");
    }

    public Teacher(String name) {
        this.name = name;
        System.out.println("有参构造执行了！");
    }
    public Teacher(){
        System.out.println("无参构造执行了！");
    }
}
